// /////////////////////////////////////////////////////////////////////////////
//
// Name:            asEntityProcessor.cpp
// Author:          Michael Bartsch (ZCCdark203)
//
// Desc :           Binds the EntityProcessor class to AngelScript
//
// License:         Copyright (C) 2009 Michael Bartsch and Contributors
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the zlib/libpng License.
//                  See main.cpp for conditions of distribution and use.
//
// /////////////////////////////////////////////////////////////////////////////

// Include files
#include "asEntityProcessor.h"

#ifdef __COMPILE_WITH_ANGELSCRIPT__

#include "../ScriptHelper.h"
#include "../core/asAssetProcessor.h"

#include "../../assets/EntityProcessor.h"

//! Binds the EntityProcessor class to AngelScript.
void bindEntityProcessor(asIScriptEngine *engine)
{
    // Forward declarations.
    int r;

    // Bind EntityProcessor class.
    r = engine->RegisterObjectType("EntityProcessor", sizeof(EntityProcessor), asOBJ_REF); assert(r >= 0);

    // Bind inherited functions.
    bindAssetProcessorBase<EntityProcessor>(engine, "EntityProcessor");

    // Set EntityProcessor behaviour.
    r = engine->RegisterObjectMethod("EntityProcessor", "EntityProcessor& opAssign(const EntityProcessor &in)",
                                     asFUNCTION(assignT<EntityProcessor>), asCALL_CDECL_OBJFIRST); assert(r >= 0);

    // Bind EntityProcessor class functions.
    r = engine->RegisterObjectMethod("EntityProcessor", "Entity@ getEntity(const string &in)",
                                     asMETHOD(EntityProcessor, getEntity), asCALL_THISCALL); assert(r >= 0);
    r = engine->RegisterObjectMethod("EntityProcessor", "void getEntityTree(Entity @+)",
                                     asMETHOD(EntityProcessor, getEntityTree), asCALL_THISCALL); assert(r >= 0);
}

#endif // __COMPILE_WITH_ANGELSCRIPT__

// End of File
